Skip to content

Fix Windows PyPI no-lockfile hosted scan test - #1994

Merged
Mikola Lysenko (mikolalysenko) merged 1 commit into
mainfrom
ci-janitor/pypi-venv-fixture-windows
Nov 3, 2026
Merged

Mikola Lysenko (mikolalysenko) merged 1 commit into
mainfrom
ci-janitor/pypi-venv-fixture-windows

Conversation

@mikolalysenko

@mikolalysenko Mikola Lysenko (mikolalysenko) commented Nov 2, 2026 •

Copy link
Copy Markdown
Collaborator

Problem

test (windows-latest, 1) is red on main. A Windows-only dispatch on main at 7a62fbd (run 41502835096) fails one test; the macOS dispatch (run 41502839104) is green:

---- hosted_scan_without_a_python_lock_warns_no_lockfile stdout ----
panicked at crates\socket-patch-cli\tests\mode_migration_pypi.rs:4463:9:
requirements-dev.txt: { "command": "scan", "status": "success", "events": [], "summary": { "discovered": 0, ...

The test arrived with #1885 at 16:08 UTC today. Windows legs run only nightly, so without this fix tonight's nightly will be red on Windows again, after 8 red nightlies in a row whose other failures were fixed today (#1852, #1894, #1905).

Root cause

venv_installed_from_patch_a writes six into lib/python3.11/site-packages. On Windows the Python crawler looks for Lib\site-packages (find_site_packages_under in python_crawler.rs), so the scan finds no installed package and the redirect_unconfirmed row the test expects never appears. Deterministic, not a flake.

Fix

Write the fixture into Lib/site-packages on Windows, as run_raw and the workspace fixture in the same file already do. Test-only change; no assertion changes. The other three tests using this helper now see the installed package on Windows too, which is what they already see on Linux and macOS.

Proof

  • Linux: cargo test -p socket-patch-cli --test mode_migration_pypi: 79/79 passed. rustfmt --check on the touched file is clean. (Local cargo clippy --test mode_migration_pypi -D warnings reports 8 pre-existing lints in untouched lines of prebuilt_common/mod.rs and line 2420; none are in this diff.)
  • Windows: Windows-only dispatch on this branch: run 41507034678 is green, including test (windows-latest, 1), which fails on main.
  • PR CI is green on e8cbeaa (ci-ok, clippy); Cursor Bugbot reported no findings.

Where tests run

No test is removed or moved.

https://claude.ai/code/session_011f9aeQitp67Dj9pTSDoSHq


Generated by Claude Code

hosted_scan_without_a_python_lock_warns_no_lockfile (#1885) fails on
the Windows test leg: venv_installed_from_patch_a writes six into
lib/python3.11/site-packages, but the Python crawler looks in
Lib\site-packages on Windows, so the scan finds nothing and the
expected redirect_unconfirmed row never appears.

Write the fixture into Lib/site-packages on Windows, the same way
run_raw and the workspace fixture in this file already do.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011f9aeQitp67Dj9pTSDoSHq
@mikolalysenko Mikola Lysenko (mikolalysenko) added the ci-janitor Opened by the CI janitor routine (flakes, redundant tests, CI perf) label Nov 2, 2026
@mikolalysenko

Copy link
Copy Markdown
Collaborator Author

bugbot run


Generated by Claude Code

@mikolalysenko

Copy link
Copy Markdown
Collaborator Author

Ready for review (burn-down agent).

  • Head: e8cbeaa
  • CI: all 98 check runs on this head are success or skipped (ci-ok, ci-ok (windows only), clippy, Windows/Ubuntu e2e and test legs green). No main-wide failures.
  • Bugbot: reviewed e8cbeaa, no issues found.
  • Reviewer focus: test-only change in crates/socket-patch-cli/tests/mode_migration_pypi.rs; the fixture now writes Lib/site-packages on Windows, matching the crawler. It fixes the red test (windows-latest, 1) on main.

Generated by Claude Code

@mikolalysenko

Copy link
Copy Markdown
Collaborator Author

Final review brief

What it does: Fixes the test fixture venv_installed_from_patch_a so it writes the venv's packages into Lib/site-packages on Windows instead of lib/python3.11/site-packages. The Python crawler looks for Lib\site-packages on Windows, so the test hosted_scan_without_a_python_lock_warns_no_lockfile (added in #1885) fails there every time and the nightly Windows run stays red. Only test code changes.

Risk: low. It is a 6-line test-only change, and it uses the same cfg!(windows) layout switch the file already uses in two places.

Look here:

  • mode_migration_pypi.rs:914-920:`` the change
  • mode_migration_pypi.rs:143-147 and :4124-4128:```` the same switch, already in use
  • python_crawler.rs:480:````` the crawler's Windows Lib/site-packages path

Verified:

  • Read the full diff. It is one file, CHANGELOG.md is untouched, and there is no debug code.
  • On this head, CI has 55 checks passing, 43 skipped and none failing, including ci-ok and clippy. The Windows-only dispatch run 41507034678 is green; that is the leg that fails on main.
  • Bugbot found nothing on e8cbeaa, and there are no review threads.
  • The other three callers of the helper now get the same installed-package layout on Windows that they already get on Linux and macOS. Their assertions are unchanged.

Changes I made: none.

Open questions: none.

Auto-merge is armed, so approving this PR sends it straight to the merge queue.


Generated by Claude Code

@mikolalysenko
Mikola Lysenko (mikolalysenko) added this pull request to the merge queue Nov 3, 2026
Merged via the queue into main with commit 531f591 Nov 3, 2026
98 checks passed
@mikolalysenko
Mikola Lysenko (mikolalysenko) deleted the ci-janitor/pypi-venv-fixture-windows branch November 3, 2026 15:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci-janitor Opened by the CI janitor routine (flakes, redundant tests, CI perf) Ready for review Agent-verified: mergeable, CI green, Bugbot clean — awaiting human review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants